Skip to content

fix: selection toolbar/handles track scroll viewport like TextField - #2762

Open
RekanDev wants to merge 2 commits into
singerdmx:masterfrom
RekanDev:fix/selection-toolbar-scroll-viewport
Open

fix: selection toolbar/handles track scroll viewport like TextField#2762
RekanDev wants to merge 2 commits into
singerdmx:masterfrom
RekanDev:fix/selection-toolbar-scroll-viewport

Conversation

@RekanDev

@RekanDev RekanDev commented Aug 21, 2026

Copy link
Copy Markdown

Summary

  • Use the scroll viewport (not the full document size) for selection-handle visibility so handles fade when scrolled out of view, matching multiline TextField / RenderEditable.
  • Hide the Cut/Copy/Paste context menu while scrolling and restore it when scrolling ends if the selection is still on-screen (including after scrolling away and back).
  • Clamp context-menu anchors into the visible editor region when the selection extends past the viewport.
  • Show the context menu again after selection-handle drag ends (or a handle tap), matching TextSelectionOverlay behavior.

Test plan

  • On Android/iOS: select text in a scrollable QuillEditor, verify Cut/Copy/Paste appears
  • Scroll down with an active selection: menu hides while scrolling; restores if selection remains visible
  • Scroll up so selection leaves the viewport: menu stays hidden; scroll back until selection is visible and release — menu restores without re-selecting
  • Selection handles should not float outside the editor when scrolling; they should fade when off-screen
  • Drag selection handles: after release, context menu appears again
  • Compare with a multiline TextField for similar feel

Made with Cursor

RekanDev and others added 2 commits August 21, 2026 11:10
Use the scroll viewport for selection-handle visibility instead of the
full document size, clamp context-menu anchors into the visible region,
and hide the Cut/Copy/Paste menu while scrolling — restoring it only
when the selection is on-screen again (including after scrolling away
and back).

Co-authored-by: Cursor <cursoragent@cursor.com>
TextField restores Cut/Copy/Paste when a handle drag ends; Quill only
cleared the magnifier offset. Recreate or rebuild the toolbar when
handles settle so adjusting anchors always brings the menu back.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant